package com.dlwx.firefighting.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.dlwx.firefighting.R;
import com.dlwx.firefighting.bean.GoodsBean;


/**
 * Created by Administrator on 2017/6/16.
 */

public class HomePageAdapter extends ListBaseAdapter<GoodsBean> {
    private Context context;

    public HomePageAdapter(Context context) {
        super(context);
        this.context=context;
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_goods;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        GoodsBean bean=getDataList().get(position);
        ImageView imageView=holder.getView(R.id.goods_img);
        TextView priceTv=holder.getView(R.id.goods_money_tv);
        TextView titleTv=holder.getView(R.id.goods_title_tv);
        TextView integralTv=holder.getView(R.id.goods_integral);
        TextView exponentTv=holder.getView(R.id.goods_exponent_tv);
        TextView tagTv=holder.getView(R.id.tag);
        TextView salesVolumeTv=holder.getView(R.id.sales_volume);
        TextView evaluateTv=holder.getView(R.id.evaluate);
//
        Glide.with(context).load(bean.getGoods_thumb()).error(R.mipmap.error_small).into(imageView);
        priceTv.setText(context.getString(R.string.rmb)+bean.getShop_price());
        titleTv.setText(bean.getGoods_name());
        integralTv.setText(""+bean.getGive_integral());
//        exponentTv.setText(bean.getGoods_brief());
//        tagTv.setText(bean.getTag_words());
        salesVolumeTv.setText("销量:"+bean.getBuy_sum());
//        evaluateTv.setText(bean.getComment_count()+"人评价");

    }
}
